﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Threading;

namespace Jy123.Web
{
    public partial class index : System.Web.UI.Page
    {
        protected void page_load(object sender, EventArgs e)
        {

        }

        protected override void Render(HtmlTextWriter writer)
        {
            base.Render(writer);
            Response.Buffer = true;
            bool isoutput = false;
            Response.Write("");
            Response.Flush();
            int lastsecond = 0;
            while (Response.IsClientConnected)
            {
                Thread.Sleep(300);
                if (DateTime.Now.Second != lastsecond && !isoutput)
                {
                    lastsecond = DateTime.Now.Second;
                    Response.Write("<script>setvalue('" + DateTime.Now.ToString() + "')\n </script> ");
                    Response.Flush();
                    isoutput = true;
                }
                else
                {
                    isoutput = false;
                }
            }
        }
    }
}

